package com.ccc.javacv.db.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.ccc.javacv.pojo.VideoInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;

/***
 * 视频流转换任务持久化表
 * @author superC
 * @version 1.0.0
 * @date 2022/8/22
 */

@Data
@EqualsAndHashCode(callSuper = true)
@TableName("device_video_task")
public class DeviceVideoTask extends VideoInfo {
    private static final long serialVersionUID = -1558005476072021013L;

    /**
     * 主键ID（即taskId）
     */
    private String id;

    public DeviceVideoTask fromVideoInfo(VideoInfo videoInfo, String id) {
        this.id = id;
        this.setFfmpeg(videoInfo.getFfmpeg());
        this.setSource(videoInfo.getSource());
        this.setTargetFormat(videoInfo.getTargetFormat());
        return this;
    }

    @Override
    public String toString() {
        return super.toString();
    }
}
